f99f286c10a2901c2ae6ba6dcfcac91fff15fdb5,plugins/org.eclipse.xtext.common.types.ui/src/org/eclipse/xtext/common/types/access/jdt/JdtBasedTypeFactory.java,JdtBasedTypeFactory,createType,#IType#IJavaProject#,385

Before Change


		IBinding[] bindings = parser.createBindings(new IJavaElement[] { jdtType }, null);
		resolveBinding.stop();
		if (bindings[0] == null)
			throw new IllegalStateException("Could not create binding for '" + jdtType.getFullyQualifiedName() + "'.");
		IBinding binding = bindings[0];
		if (binding instanceof ITypeBinding) {
			createType.start();

After Change


			throw new IllegalArgumentException("Cannot create type from non-toplevel-type: '"
					+ jdtType.getFullyQualifiedName() + "'.");
		IBinding binding = resolveBindings(jdtType, javaProject);
		if (binding == null) {
			IJavaProject fallbackProject = jdtType.getJavaProject();
			// fallback to the project of the given jdtType if it is different from the explicitly given project
			if (!fallbackProject.equals(javaProject)) {
				binding = resolveBindings(jdtType, fallbackProject);
				if (binding == null) {
					throw new IllegalStateException("Could not create binding for '" + jdtType.getFullyQualifiedName() + 
							"' in context of projects '" + javaProject.getElementName() + "' and '" + fallbackProject.getElementName() + "'.");
				}
			} else {